DIR=clox/src
DIST=build/clox
SOURCE=$(wildcard $(DIR)/*.c)
OBJECTS=$(patsubst $(DIR)%,$(DIST)%,$(SOURCE:%.c=%.o))

all: $(OBJECTS)
	gcc -g -o clox.bin $^

$(DIST)/%.o: $(DIR)/%.c
	@ mkdir -p $(DIST)
	gcc -g -c -o $@ $<


